True if value is currently a member of target, false otherwise.
set_has(target, value) -> bool| Name | Type |
|---|---|
target | set |
value | element |
bool
true if value is currently a member of target, false otherwise. This is the entire point of reaching for a set<T> instead of a list<T> - checking membership is fast no matter how many values target already holds.
/// @type {set<int>}
var visited = [5];
var has5 = set_has(visited, 5); // true
var has6 = set_has(visited, 6); // false



Just the hash set's contains() - O(1) average.